<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>admision</title>
            <link type="text/css" href="../common/css/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/administrar.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/ui.panel.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery-1.4.2.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery.ui.all.js"></script>
            <script type="text/javascript" src="../common/js/jquery.layout.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-1.8.6.custom.min.js"></script>
            <script type="text/javascript" src="../common/js/jquery-ui-timepicker-addon.js"></script>
            <script type="text/javascript" src="../common/js/calendarioui-es.js"></script>
            <script type="text/javascript" src="../common/js/jquery.dateentry.js"></script>
            <script type="text/javascript" src="../common/js/admision.js"></script>
            <script type="text/javascript" src="../common/js/jquery.validate.js"></script>
            <script type="text/javascript" src="../common/js/messages_es.js"></script>
            <script type="text/javascript" src="../common/js/ui.panel.js"></script>
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>        
            <script type="text/javascript" src="../common/js/interface.js"></script>
            <script type="text/javascript" src="../common/js/jquery.timeentry.js"></script>
            <script type="text/javascript" src="../common/js/jquery.pagination.js"></script>
            <script type="text/javascript" src="../common/js/jquery.contextMenu.js"></script>
            <link type="text/css" href="../common/css/jquery.contextMenu.css" rel="stylesheet" />
            <link type="text/css" href="../common/css/pagination.css" rel="stylesheet" />
            <script type="text/javascript" src="../common/js/jquery.qtip-1.0.0-rc3.js"></script>
            <link type="text/css" href="../common/css/jquery.timeentry.css" rel="stylesheet" />

        </head>
        <body> 

            <table width="100%">
                <tr  class="ui-state-hover">
                    <td align="left">
                        <button id="nuevaAdmisionBtn">Nueva</button>       
                    </td>
                    <td>
                        <div id="btnesAdmision" align="center"> 
                            <table>
                                <tr>

                                    <td>
                                        <button id="btnAmbulatoria">Ambulatoria</button>
                                    </td>

                                    <td>
                                        <button id="btnUrgencia">Urgencia</button>
                                    </td>

                                    <td>
                                        <button id="btnHospitalizacion">Hospitalizaci&oacute;n</button>
                                    </td>

                                </tr>  
                            </table>
                        </div>
                    </td>

                    <td align="right">
                        <button id="ayudaBtn">Ayuda</button>               
                    </td>

                </tr>
            </table>  

            <div class="tooltips"></div>

            <!--<h3 style="text-align: center" class="ui-widget-header">Admisi&oacute;n</h3>-->

            <div  id="pantalla-admision-gral">

                <!--<form id="form-admision">-->

                    <div id="panel1">

                        <h3>Datos Admision</h3>

                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr class="ui-state-hover">                                    
                                
                                <td>
                                    Fecha
                                </td>

                                <td>
                                    Identificaci&oacute;n / TD
                                </td>

                                <td>
                                    Nombre Completo
                                </td>

                                <td>
                                    Edad
                                </td>

                                <td>
                                    Sexo 
                                </td>    

                                <td>
                                    Regimen
                                </td>

                                <td style="display: none">
                                    Nivel
                                </td>

                                <td style="display: none">
                                    T. Afiliaci&oacute;n
                                </td>                                                                       

                                <td style="display: none">
                                    Tipo Poblac&oacute;on
                                </td>

                                <td style="display: none">
                                    Tipo Paciente
                                </td>

                            </tr>

                            <tr> 
                                <td>
                                    <input type="text" size="11" id="fecadmision" name="fecadmision" value="" />    
                                </td>  

                                <td>
                                    <table>
                                        <tr>

                                            <td>
                                                <input type="text" size="8" ondblclick="buscarPacienteCodigo()" maxlength="20" id="identificacion" value=""/>
                                                <input type="hidden" id="idpaciente" name="idpaciente" value="" />
                                                <input type="hidden" id="idmanual" value="" />

                                                <!--se sobreescribe con idcps-->
                                                <input type="hidden" id="idcontrato" value="" />
                                            </td>

                                            <td>  
                                                
                                                <select style="width: 45px" id="id_tipo_ide" name="id_tipo_ide" class="text ui-widget-content"></select>
                                                
                                                
                                            </td>

                                            <td>                                        
                                                <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />                                                    
                                            </td>

                                            <td>
                                                <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" /> 
                                            </td>
                                        </tr>
                                    </table>
                                </td>


                                <td>
                                    
                                    <input type="text" size="32" readonly="true" id="nombres" value="" />

                                </td>

                                <td>
                                    <input type="text" size="3" readonly="true" id="edad" value=""/>

                                </td>


                                <td>
                                    <input type="text" size="1" readonly="true" id="sexo" value=""/>

                                </td>
                                <td>
                                    <input type="text" size="7" readonly="true" id="regimen" value=""/>

                                </td>

                                <td style="display: none">
                                    <input type="text" size="1" readonly="true" id="nivel" value=""/>

                                </td>

                                <td style="display: none">
                                    <input type="text" size="6" readonly="true" id="tipoafiliado" value=""/>

                                </td>

                                <td style="display: none">
                                    <input type="text" size="1" readonly="true" id="tipoPoblacion" value=""/>

                                </td>

                                <td style="display: none">
                                    <input type="text" size="1" readonly="true" id="tipoPaciente" value=""/>

                                </td>

                            </tr>

                            <tr class="ui-state-hover">
                                <td colspan="2">
                                    Administradora
                                </td>

                                <td>
                                    Contratos Disponibles
                                </td>

                                <td colspan="3">
                                    Autorizaci&oacute;n
                                </td>

                            </tr>

                            <tr>
                                <td colspan="2" >
                                    <select style="width: 400px" id="id_entidad" name="id_entidad" class="text ui-widget-content"></select>
                                </td>

                                <td>
                                    
                                    <select style="width: 355px" id="idcps" name="idcps" class="text ui-widget-content"></select>
                                    
                                </td>     

                                <td colspan="3">
                                    <input type="text" size="19" id="autorizacion" value="" />
                                </td>   

                            </tr>
                            <!---->
                            <tr class="ui-state-hover">                            

                                <td colspan="2">
                                    Via de Ingreso
                                </td>

                                <td> 
                                    Estado Ingreso
                                </td> 

                                <td colspan="2">
                                    U.Funcional
                                </td>

                                <td>
                                    Prioridad
                                </td>         


                            </tr>
                            <tr>


                                <td colspan="2">
                                    <select style="width: 400px" id="id_via" name="id_via" class="text ui-widget-content"></select>                          
                                </td>


                                <td>              
                                    <select style="width: 355px" id="id_estadoing" name="id_estadoing" class="text ui-widget-content"></select>
                                </td>

                                <td colspan="2">
                                    <select style="width: 120px" id="id_undfunc" name="id_undfunc" class="text ui-widget-content"></select>                          
                                </td>

                                <td>
                                    <select style="width: 111px" id="id_prioridad" name="id_prioridad" class="text ui-widget-content"></select>   
                                </td>

                            </tr>


                            <tr class="ui-state-hover">

                                <td colspan="2">
                                    Causa Externa
                                </td>

                                <td>
                                    Diagn&oacute;stico
                                </td>

                                <td colspan="3">
                                    M&eacute;dico
                                </td>


                            </tr>

                            <tr>

                                <td colspan="2">
                                    <select style="width: 400px" id="id_causaex" name="id_causaex" class="text ui-widget-content"></select>
                                </td>                            

                                <td>
                                    <input type="text" size="32" readonly="true"  maxlength="40" id="codDx" value="" ondblclick="buscarDiag(1)"/>
                                    <input type="hidden" id="idDx" name="idDx" value="" />
                                </td>

                                <td colspan="3">
                                    <select style="width: 232px" id="id_medico" name="id_medico" class="text ui-widget-content"></select>
                                </td>


                            </tr>                          



                        </table>
                    </div>
                <!--</form>-->






                <div id="panel-admision" style="display: none">

                    <div id="panel-ambulatoria">
                        <h4>Ambulatoria</h4>                
                        <table width="100%" cellpadding="0" cellspacing="0"> 
                            <tr class="ui-state-hover">             

                                <td>
                                    Tipo Cuota/ TD
                                </td>

                                <td>
                                    Valor cuota
                                </td>   
                                <td>
                                    Motivo Consulta
                                </td>

                            </tr>
                            <tr>

                                <td>                                        
                                    <select style="width: 400px" id="tipocuota" name="tipocuota" class="text ui-widget-content"></select>    
                                </td>

                                <td>
                                    <input type="text" size="10" id="valorcuota" name="valorcuota" value=""/>
                                </td>

                                <td>
                                    <input type="text" size="41" id="motivo_amb" name="notivo_amb" />
                                </td>

                            </tr>



                        </table>               

                    </div>

                    <div id="panel-urgencia">
                        <h4>Urgencias</h4>
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr class="ui-widget-header">
                                <td>
                                    pabell&oacute;n
                                </td>
                                <td>
                                    cuarto
                                </td>                                        
                                <td>
                                    Nro Cama
                                </td>

                                <td>
                                    Dependencia Func
                                </td>

                                <td>
                                    Tipo Urgencia
                                </td>
                            </tr>

                            <tr>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="pabelloningahu" name="pabelloningahu" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="cuartoingahu" name="cuartoingahu" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 150px" class="text ui-widget-content" id="camaingahu" name="camaingahu" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="iddependenciau" name="iddependenciau" value=""></select>
                                </td>
                                
                                <td>
                                    <select style="width: 230px" class="text ui-widget-content" id="id_tipourg" name="id_tipourg" value=""></select>

                                </td>
                            </tr>

                            <tr class="ui-state-hover">
                                <td>
                                    Condici&oacute;n
                                </td>

                                <td>
                                    Tipo Cuota
                                </td>

                                <td>
                                    Valor cuota
                                </td>   
                               
                            </tr>

                            <tr class="ui-widget-header">

                                <td>                                        
                                    <select style="width: 200px" id="idcondicion" name="idcondicion" class="text ui-widget-content"></select>    
                                </td>

                                <td>                                        
                                    <select style="width: 200px" id="tipocuota" name="tipocuota" class="text ui-widget-content"></select>    
                                </td>

                                <td>
                                    <input type="text" size="10" id="valorcuota" name="valorcuota" value=""/>
                                </td>

                                

                            </tr>


                        </table>
                    </div>


                    <div id="panel-hospitalizacion">
                        <h3>Hospitalizaci&oacute;n</h3>
                        <table width="100%" cellpadding="0" cellspacing="0">

                            <tr class="ui-state-hover">
                                <td>
                                    pabell&oacute;n                                
                                </td>
                                
                                <td>
                                    cuarto                                
                                </td>                                        
                                
                                <td>
                                    Nro Cama
                                </td>

                                <td>
                                    Dependencia Func
                                </td>

                                <td>
                                    Tipo Estancia
                                </td>
                                
                            </tr>

                            <tr>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="pabelloningah" name="pabelloningah" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="cuartoingah" name="cuartoingah" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 150px" class="text ui-widget-content" id="camaingah" name="camaingah" value="0"></select>
                                </td>

                                <td>
                                    <select style="width: 200px" class="text ui-widget-content" id="iddependencia" name="iddependencia" value=""></select>
                                </td>
                                <td>
                                    <select style="width: 230px" class="text ui-widget-content" id="idtipoestancia" name="idtipoestancia" value=""></select>

                                </td>
                            </tr>


                        </table>
                    </div>
                </div> 


                <!---->
                <div id="panel-acompanante">
                    <h4>Datos Acompañante</h4>
                    <div>
                        <table id="tabaco" class='ui-widget-content' width="100%" cellpadding="0" cellspacing="0">

                            <tr class="ui-widget-header">                                    

                                <td>
                                    Identificaci&oacute;n / TD
                                </td>

                                <td>
                                    Nombre Completo
                                </td>

                                <td>
                                    Direcci&oacute;n
                                </td>

                                <td>
                                    Tel&eacute;fono
                                </td>

                            </tr>

                            <tr> 
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <input type="text" size="10" ondblclick="buscarPacienteCodigo()" maxlength="20" id="identificacionaco" value=""/>
                                                <input type="hidden" id="idaco" name="idaco" value="" />

                                            </td>
                                            <td>

                                            <select style="width: 120px" readonly ="true"  id="id_tipo_ideaco" name="id_tipo_ideaco" class="ui-widget-content"></select>
                                            
                                            </td>

                                            <td>                                        
                                                <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />                                                    
                                            </td>

                                            <td>
                                                <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" /> 
                                            </td>
                                        </tr>
                                    </table>
                                </td>


                                <td>
                                    <input type="text" size="30" readonly="true" id="nombresaco" value="" />

                                </td>

                                <td>
                                    <input type="text" size="18" readonly="true" id="direccionaco" value=""/>

                                </td>


                                <td>
                                    <input type="text" size="9" readonly="true" id="telefonoaco" value=""/>

                                </td>

                            </tr>
                        </table>

                    </div>

                </div>


                <div id="panel-remite">
                    <h4>Datos Remite</h4>
                    <div>

                        <table id="tabrem" class="ui-widget-content" width="100%" cellpadding="0" cellspacing="0">
                            <tr class="ui-widget-header">                                    

                                <td>
                                    C&oacute;digo IPS
                                </td>

                                <td>
                                    Nombre IPS
                                </td>

                            </tr>

                            <tr> 
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <input type="text" size="10" ondblclick="buscarPacienteCodigo()" maxlength="20" id="codigoipsrem" value=""/>
                                                <input type="hidden" id="idipsrem" name="idipsrem" value="" />

                                            </td>


                                            <td>                                        
                                                <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />                                                    
                                            </td>

                                            <td>
                                                <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" /> 
                                            </td>
                                        </tr>
                                    </table>
                                </td>


                                <td colspan="3">
                                    <input type="text" size="64" readonly="true" id="nombreipsrem" value="" />

                                </td>


                            </tr>


                            <tr class="ui-widget-header">                                  

                                <td>
                                    Identificaci&oacute;n / TD
                                </td>

                                <td>
                                    Nombre Completo
                                </td>

                                <td>
                                    Direcci&oacute;n
                                </td>

                                <td>
                                    Tel&eacute;fono
                                </td>

                            </tr>

                            <tr> 
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <input type="text" size="10" ondblclick="buscarPacienteCodigo()" maxlength="20" id="identificacionrem" value=""/>
                                                <input type="hidden" id="idrem" name="idpaciente" value="" />

                                            </td>

                                            <td>
                                                <select style="width: 120px" readonly ="true"  id="id_tipo_iderem" name="id_tipo_iderem" class="ui-widget-content"></select>
                                            </td>

                                            <td>                                        
                                                <img src="../common/img/user_search.png"  onclick="buscarPacienteCodigo()" style="cursor: pointer" alt="buscarPaciente" />                                                    
                                            </td>

                                            <td>
                                                <img src="../common/img/edit-clear.png" onclick="clearPacientecodigo()" style="cursor: pointer" alt="Eliminar" /> 
                                            </td>
                                        </tr>
                                    </table>
                                </td>


                                <td>
                                    <input type="text" size="30" readonly="true" id="nombresrem" value="" />

                                </td>

                                <td>
                                    <input type="text" size="18" readonly="true" id="direccionrem" value=""/>

                                </td>


                                <td>
                                    <input type="text" size="9" readonly="true" id="telefonorem" value=""/>

                                </td>

                            </tr>

                        </table>
                    </div>
                </div>



                <!--</div>-->    

                <!--Buscar Pacientes-->
                <div id="dialogoBuscarPac" style="display: none" title="PACIENTES">


                    <div id="busquedaDivPac">
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr class="ui-widget-header">
                                <td>
                                    Identificaci&oacute;n
                                </td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr class="ui-widget-header">                    
                                <td>
                                    <input onkeyup="validarBusquedaPac(1)" type="text" id="ide" size="16" maxlength="16"/>
                                </td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>

                            <tr class="ui-widget-header">

                                <td>Primer Nombre</td>
                                <td>Segundo Nombre</td>
                                <td>Primer Apellido</td>
                                <td>Segundo Apellido</td>
                            </tr>
                            <tr>                    
                                <td>
                                    <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n1" size="15" maxlength="20"/>
                                </td>
                                <td>
                                    <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="n2" size="15" maxlength="20"/>
                                </td>
                                <td>
                                    <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a1" size="15" maxlength="20"/>
                                </td>
                                <td>
                                    <input onkeyup="this.value=this.value.toUpperCase();validarBusquedaPac(2)" type="text" id="a2" size="15" maxlength="20"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5" align="center">
                                    <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" id="buscarPac" type="button" value="Buscar"/>
                                </td>
                            </tr>

                        </table>
                    </div>


                    <div id="datosPac" style="display: none">
                    </div>

                </div>


                <div id="dialogo-buscar-diagnosticos" title="Buscar Diagnosticos" style="display: none">
                    <div class="ui-widget">         

                        <input id="tdx" type="text" />

                        <table>
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>Descripci&oacute;n</td>
                            </tr>                          
                            <tr>
                                <td>
                                    <input id="cdxs" size="10" />
                                </td>
                                <td>
                                    <input id="dxs" size="30" />
                                </td>
                            </tr>
                        </table>      
                    </div>
                </div>

                <div id="dialogo-buscar-ipsr" title="Buscar prestadores" style="display: none">
                    <div class="ui-widget">                 
                        <table>
                            <tr class="ui-widget-header">
                                <td>C&oacute;digo</td>
                                <td>Descripci&oacute;n</td>
                            </tr>                          
                            <tr>
                                <td>
                                    <input id="cipsr" size="10" />
                                </td>
                                <td>
                                    <input id="dipsr" size="30" />
                                </td>
                            </tr>
                        </table>      
                    </div>
                </div>


                <div id="dialogo-buscar-acom" title="Acompañante" style="display: none">
                    <div class="ui-widget">                 
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr class="ui-widget-header">
                                <td>Identificaci&oacute;n</td>
                                <td>Nombres</td>
                            </tr>                          
                            <tr>
                                <td>
                                    <input id="ideacom" size="15" />
                                </td>
                                <td>
                                    <input id="nomacom" size="30" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="ui-widget-header"></td>
                                <input id="id_acom" type="hidden"  />
                            </tr>
                            <tr>
                                <td>Tipo Identificaci&oacute;n</td>
                                <td>
                                    <select style="width: 270px" id="id_tipoideacom" name="id_tipoideacom" class="text ui-widget-content"></select>
                                </td>
                            </tr>
                            <tr>
                                <td>Nombres</td>
                                <td>
                                    <input type="text" size="30" id="nombresacom"  name="nombresacom" value="" />
                                </td>
                            </tr>
                            <tr>
                                <td>Apellidos</td>
                                <td>
                                    <input type="text" size="30" id="apellidosacom"  name="apellidosacom" value="" />
                                </td>
                            </tr>
                            <tr>
                                <td>Direcci&oacute;n</td>
                                <td>
                                    <input type="text" size="30" id="direccionacom"  name="direccionacom" value="" />
                                </td>
                            </tr>
                            <tr>
                                <td>Tel&eacute;fono</td>
                                <td>
                                    <input type="text" size="30" id="telefonoacom"  name="telefonoacom" value="" />
                                </td>
                            </tr>

                        </table> 
                    </div>
                </div>

                <div class="qtip qtip-stylename">
                    <div class="qtip-tip" rel="cornerValue"></div>
                    <div class="qtip-wrapper">
                        <div class="qtip-borderTop"></div>
                        <div class="qtip-contentWrapper">
                            <div class="qtip-title">
                                <div class="qtip-button"></div>
                            </div>
                            <div class="qtip-content"></div>
                        </div>
                        <div class="qtip-borderBottom"></div>
                    </div>
                </div>

            </div>

        </body>
    </f:view>
</html>
